package org.learn.test;

public class HomeWork10 {
    public static void main(String[] args) {
        Book b = new Book();
        System.out.println(b.updatePrice(151));
        //
        A03 a03 = new A03();
        int[] arr = {1,3,5,76,8,4,6,4,7,};
        int[] arr01 = a03.copyArr(arr);
        //遍历数组
        for(int i = 0;i < arr01.length;i++){
            System.out.print(arr01[i] + "\t");


        }
        Circle a04 = new Circle();
        System.out.println("周长=" + a04.perimeter(15));
        System.out.println("面积=" + a04.area(15));
    }
}
class Book {
    public int updatePrice(int n) {
        if (n > 150) {
            n = 150;
        } else if (n >= 100) {
            n = 100;
        }
        return n;
    }
}
class A03 {


    public int[] copyArr(int[] oldArr){
        int[] newArr = new int[oldArr.length];
        for(int i = 0; i < oldArr.length; i++){
            newArr[i] = oldArr[i];
        }
        return newArr;
    }
}
class Circle {//求周长，面积方法
    double rad;
    public double perimeter(double rad){
        return rad * 2 * Math.PI;
    }
    public double area(double rad){
        return rad * rad *Math.PI;
    }
}
